<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich" >
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>付款申请单审核</title>
        <script type="text/javascript">
            function updateCostItemName(code, name)
            {
                document.getElementById('appBill:costcode').value = code;
                document.getElementById('appBill:costname').value = name;
            }
            function showCostItem() {
                window.open("./page/pay/check/ecoList.jsf", "经济科目", "height=1024,width=800,toolbar=no,menubar=no,scrollbars=no");
            }
        </script>

        <style type="text/css">
            .demo_fieldset {
                margin : 20px;
                border : 1px solid #ACBECE;
            }
            .demo_legend {
                font-weight : bold;
                margin : 0px 10px 0px 18px;
                font-family: Verdana;
            }
            .inputstype{
                width: 175px !important;
            }
            .pic{
                margin-bottom: -4px;
                margin-right: -2px;
                border:none;
                width:20px;
                height:20px;
            }
            .voucherGrid{
                width: 100%;
                border: 1px solid #e2e2e2;
                border-collapse: collapse;
            }
            .col1{
                border: 1px solid #e2e2e2;
                width:50px;
                padding: 3px 5px 3px 5px;
                text-align:justify;
                text-justify:distribute-all-lines;/*ie6-8*/
                text-align-last:justify;/* ie9*/
                -moz-text-align-last:justify;/*ff*/
                -webkit-text-align-last:justify;/*chrome 20+*/
            }
            .col2{
                border: 1px solid #e2e2e2;
                padding-left: 5px;
                text-align: left;
            }
            .tbstyle{
                width:100%;
                border:1px solid #e2e2e2;
                text-align: left;
                border-collapse: collapse;
            }
        </style>
    </h:head>
    <h:body>
        <h:form id="appBill">
            <rich:panel header="付款申请单审核" styleClass="content-hight">
                <rich:messages globalOnly="true"/>
                <h:panelGrid columns="2">
                    <h:outputLabel value="单据状态:"/>
                    <h:panelGroup>
                        <h:outputText value="审核通过"  rendered="#{payAppCheck.voucher.numberStatus == '2'}" style="color:blue"/>
                        <h:outputText value="退回修改"  rendered="#{payAppCheck.voucher.numberStatus == '3'}" style="color:red"/>
                        <h:outputText value="等待审核"  rendered="#{payAppCheck.voucher.numberStatus == '0'}" style="color:green"/>
                        <h:outputText value="支付成功"  rendered="#{payAppCheck.voucher.numberStatus == '4'}" style="color:blue"/>
                        <h:outputText value="支付完毕"  rendered="#{payAppCheck.voucher.numberStatus == '6'}" style="color:blue"/>
                    </h:panelGroup>
                </h:panelGrid>
                <rich:toolbar  itemSeparator="grida">
                    <rich:toolbarGroup>
                        <h:commandLink  action="#{payAppCheck.checkandRep}"
                                        onclick="return confirm('确定通过？');"
                                        disabled="#{payAppCheck.voucher.numberStatus != '0'}">
                            <h:graphicImage value="./images/check.png" styleClass="pic" title="通过" />
                        </h:commandLink>
                        <h:commandLink  action="#{payAppCheck.back}"
                                        onclick="return confirm('确定退回？');"
                                        disabled="#{payAppCheck.voucher.numberStatus != '0'}">
                            <h:graphicImage value="./images/return.png" styleClass="pic" title="退回" />
                        </h:commandLink>
                        <h:commandLink  action="#{payAppCheck.rescind}"
                                        disabled="#{payAppCheck.voucher.numberStatus != '2'}">
                            <h:graphicImage value="./images/chexiao.png" styleClass="pic" title="撤销" />
                        </h:commandLink>
                        <h:commandLink  action="#{payAppCheck.getFirst}">
                            <h:graphicImage value="./images/btn_page_first.gif" styleClass="pic" title="首张" />
                        </h:commandLink>
                        <h:commandLink  action="#{payAppCheck.previous}">
                            <h:graphicImage value="./images/btn_page_up.gif" styleClass="pic" title="上张" />
                        </h:commandLink>
                        <h:commandLink action="#{payAppCheck.next}">
                            <h:graphicImage value="./images/btn_page_down.gif" styleClass="pic" title="下张" />
                        </h:commandLink>
                        <h:commandLink  action="#{payAppCheck.getLast}">
                            <h:graphicImage value="./images/btn_page_end.gif" styleClass="pic" title="末张" />
                        </h:commandLink>
                        <h:commandLink  action="#{payAppCheck.toCata}">
                            <h:graphicImage value="./images/goback.png" styleClass="pic" title="返回" />
                        </h:commandLink>
                    </rich:toolbarGroup>
                </rich:toolbar>

                <fieldset class="demo_fieldset">
                    <legend class="demo_legend">付款申请单</legend>
                    <h:panelGroup  id="edit">
                        <table class="voucherGrid">
                            <tbody>
                                <tr>
                                    <td class="col1"><label>单据日期</label></td>
                                    <td class="col2" colspan="3">
                                        <h:outputText value="#{payAppCheck.voucher.numDate}">
                                            <f:convertDateTime pattern="yyyy年mm月dd日" timeZone="GMT+8"/>
                                        </h:outputText>
                                    </td>
                                    <td class="col1">
                                        <label>单据编号</label></td>
                                    <td class="col2" colspan="3"><h:outputText value="#{payAppCheck.voucher.number}"/></td>
                                </tr>
                                <tr>
                                    <td class="col1"><label>付款部门</label></td>
                                    <td class="col2"><h:outputText value="#{payAppCheck.voucher.payDept.name}"/></td>
                                    <td class="col1"><label>申请人</label></td>
                                    <td class="col2"><h:outputText value="#{payAppCheck.voucher.feePer.cpsn_name}"/></td>
                                    <td class="col1"><label>支出类别</label></td>
                                    <td class="col2" colspan="3">
                                        <h:outputText value="基本支出" rendered="#{payAppCheck.voucher.project.costType eq 0}"/>
                                        <h:outputText value="项目支出" rendered="#{payAppCheck.voucher.project.costType eq 1}"/>
                                    </td>
                                </tr>                                
                                <tr>
                                    <td class="col1"><label>收款单位</label></td>
                                    <td class="col2" colspan="7"><h:outputText value="#{payAppCheck.partner.simplename}"/></td>
                                </tr>
                                <tr>
                                    <td class="col1"><label>开户行</label></td>
                                    <td class="col2" colspan="3"><h:outputText value="#{payAppCheck.partner.bank}"/></td>
                                    <td class="col1"><label>项目内容</label></td>
                                    <td class="col2" colspan="3"><h:outputText value="#{payAppCheck.voucher.project.finName}"/></td>
                                </tr>
                                <tr>
                                    <td class="col1"><label>账 号</label></td>
                                    <td class="col2" colspan="3"><h:outputText value="#{payAppCheck.partner.bankAccount}"/></td>
                                    <td class="col1"><label>项目编码</label></td>
                                    <td class="col2" colspan="3"><h:outputText value="#{payAppCheck.voucher.customProjCode}"/></td>
                                </tr>                                
                                <tr>
                                    <td class="col1"><label>用 途</label></td>
                                    <td class="col2" colspan="7"><h:outputText value="#{payAppCheck.voucher.affair}"/></td>                                  
                                </tr>                            
                                <tr>
                                    <td class="col1"><label>金 额</label></td>
                                    <td class="col2">
                                        <h:outputText value="#{payAppCheck.voucher.total}" >
                                            <f:convertNumber type="number" pattern="#,##0.00"/>
                                        </h:outputText>
                                    </td>
                                    <td class="col1"><label>付款方式</label></td>
                                    <td class="col2"><h:outputText value="#{payAppCheck.voucher.payStyle.name}"/></td>         
                                    <td class="col1"><label>备 注</label></td>
                                    <td class="col2" style="width: 100px;"><h:outputText value="#{payAppCheck.voucher.memo}"/></td>    
                                    <td class="col1"><label>附件张数</label></td>
                                    <td class="col2" style="100px"><h:outputText value="#{payAppCheck.voucher.affixAmount}"/></td>    
                                </tr>
                            </tbody>
                        </table>
                        <br/>
                        <span>
                            <h:outputLabel value="制单人：" />
                            <h:outputText value="#{payAppCheck.voucher.dept.name} —— #{payAppCheck.voucher.user.cpsn_name}"/>
                        </span>
                    </h:panelGroup>
                </fieldset>
                <fieldset class="demo_fieldset">
                    <legend class="demo_legend">付款申请单审核</legend>
                    <h:panelGrid columns="4" width="100%" border="0" id="mainform1" >
                        <h:outputLabel value="核定金额:"  />
                        <h:inputText  id="totalnew"   size="28" value="#{payAppCheck.voucher.checkaccount}"
                                      disabled="#{payAppCheck.voucher.numberStatus != '0'}">
                            <f:convertNumber type="number" pattern="#,##0.00"/>
                        </h:inputText>
                        <h:outputLabel value="经济分类:"  />
                        <h:inputText  id="costname"   size="28"  value="#{payAppCheck.voucher.costitem.name}"
                                      onclick="showCostItem()" disabled="#{payAppCheck.voucher.numberStatus != '0'}"/>
                        <h:outputText value="预算来源："  />
                        <h:selectOneRadio   value="#{payAppCheck.voucher.budgetSource}"
                                            disabled="#{payAppCheck.voucher.numberStatus != '0'}">
                            <f:selectItem itemLabel="当年预算" itemValue="当年预算"/>
                            <f:selectItem itemLabel="上年结余" itemValue="上年结余"/>
                        </h:selectOneRadio>
                        <h:outputText value="支出类别:" />
                        <h:selectOneRadio value="#{payAppCheck.voucher.costClass}"
                                          disabled="true" >
                            <f:selectItem itemLabel="基本支出" itemValue="0"/>
                            <f:selectItem itemLabel="项目支出" itemValue="1"/>
                        </h:selectOneRadio>
                        <h:outputText value="支出渠道:" />
                        <h:selectOneMenu  id="costType" value="#{payAppCheck.voucher.costTypes.code}"
                                          style=" width: 198px;" disabled="#{payAppCheck.voucher.numberStatus != '0'}">
                            <f:selectItem itemValue=" " itemLabel="-请选择-"/>
                            <f:selectItems value="#{class.selectItemList}" />
                        </h:selectOneMenu>

                        <a4j:commandButton value="支付令:" render="paycode" action="#{payAppCheck.buildPaycode}"
                                           disabled="#{payAppCheck.voucher.numberStatus != '0'}"/>
                        <h:inputText  id="paycode" size="28"  value="#{payAppCheck.voucher.paycode}"
                                      disabled="#{payAppCheck.voucher.numberStatus != '0'}"/>
                    </h:panelGrid>
                    <hr/>
                    <h:panelGrid columns="2" width="100%" columnClasses="col1,col2">
                        <h:outputLabel value="审核意见:"/>
                        <h:inputTextarea value="#{payAppCheck.voucher.checkInfo}" cols="100" disabled="#{payAppCheck.voucher.numberStatus != '0'}"/>
                    </h:panelGrid>
                    <hr/>
                    <h:panelGrid columns="4" width="100%" border="0" columnClasses="col1,col2,col1,col2">
                        <h:outputLabel value="审核人:" />
                        <h:outputText value="#{payAppCheck.voucher.auditor}"/>
                        <h:outputLabel value="审核日期:" />
                        <h:outputText value="#{payAppCheck.voucher.auditDate}">
                            <f:convertDateTime pattern="yyyy年MM月dd日"/>
                        </h:outputText>
                    </h:panelGrid>
                </fieldset>

            </rich:panel>
        </h:form>
    </h:body>
</html>
